package com.stark.commons.spring.core.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.core.annotation.AliasFor;

import com.stark.commons.spring.core.support.sql.DataSourceLookupKeyProvider;
import com.stark.commons.spring.core.support.sql.DataSourceLookupKeyProvider.NoDataSourceLookupKeyProvider;

/**
 * 标注数据源。
 * <p>用于注解类或方法，使用标注的数据源。
 * @author Ben
 * @since 1.0.0
 * @version 1.0.0
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface DataSource {
	
	@AliasFor("value")
    String dataSource() default "";
    
    @AliasFor("dataSource")
    String value() default "";
    
    String lookupKeyCondition() default "";
    
    Class<? extends DataSourceLookupKeyProvider> lookupKeyProvider() default NoDataSourceLookupKeyProvider.class;
    
}

